package com.hunray.rent.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;

@NoRepositoryBean
public interface IBaseDao<T, I extends Serializable> extends
		JpaRepository<T, I> {

	List<T> queryByJpql(String jpql, Object[] args, Map<String, Object> params,
			Map<String, String> orders);

	List<T> queryBySql(String sql, Object[] args, Map<String, Object> params,
			Map<String, String> orders);

	Page<T> queryByJpql(String jpql, Object[] args, Map<String, Object> params,
			Map<String, String> orders, Pageable pageable);

	Page<T> queryBySql(String sql, Object[] args, Map<String, Object> params,
			Map<String, String> orders, Pageable pageable);

	void updateOrDeleteByJpql(String jpql, Object[] args,
			Map<String, Object> params);

}
